package com.sg.qcgl.app.ball_team.executor.query;


import com.aimoss.core.pojo.PageBean;
import com.sg.qcgl.domain.ball_team.model.BallTeam;
import com.sg.qcgl.domain.ball_team.gateway.BallTeamGateway;
import com.sg.qcgl.infra.repository.ball_team.BallTeamRepository;
import com.sg.qcgl.client.ball_team.dto.BallTeamDTO;
import com.sg.qcgl.client.ball_team.dto.BallTeamPageQueryDTO;
import com.sg.qcgl.client.ball_team.vo.BallTeamVO;
import com.sg.qcgl.app.ball_team.convertor.BallTeamDTOConvertor;
import com.aimoss.core.dto.MultiResponse;
import com.aimoss.core.dto.SingleResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class BallTeamQryExe {

    @Autowired
    private BallTeamGateway ballTeamGateway;

    @Autowired
    private BallTeamRepository ballTeamRepository;

    public PageBean<BallTeamVO> page(BallTeamPageQueryDTO ballTeamPageQueryDTO) {
        PageBean<BallTeamVO> result = ballTeamGateway.page(ballTeamPageQueryDTO);
        return result;
    }

    public List<BallTeamVO> list(BallTeamDTO queryDTO) {
        List<BallTeamVO> ballTeamVOList = ballTeamGateway.list(queryDTO);
        return ballTeamVOList;
    }

    public BallTeamVO findById(Long id) {
        BallTeam ballTeam = ballTeamGateway.findById(id);
        BallTeamVO ballTeamVO = BallTeamDTOConvertor.toVO(ballTeam);
        return ballTeamVO;
    }




}

